import 'package:flutter/material.dart';

class ListViewBuilderCase extends StatelessWidget {
  const ListViewBuilderCase({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemBuilder: (BuildContext context, int index) {
        return Container(
          width: double.infinity, // 宽度
          margin: EdgeInsets.all(10),
          decoration: BoxDecoration(
              color: Colors.red, borderRadius: BorderRadius.circular(10)),
          height: 100,
          alignment: Alignment.center,
          child: Text(
            "第${index + 1}个",
            style: TextStyle(color: Colors.white, fontSize: 30),
          ),
        );
      },
      itemCount: 5,
    );
  }
}
